﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
    <script src="~/js/frame.js"></script>
</head>
<body>
    <div class="container-fluid">
        <form id="form">
            <div class="formrow">
                <div class="col-xs-12">
                    <div class="formtitle required">所属部门</div>
                    <div class="formcontent">
                        <cloud-tree id="OUGuid" url="tree" control-type="selectou" select-type="single"></cloud-tree>
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-6">
                    <div class="formtitle required">登录名</div>
                    <div class="formcontent">
                        <input name="LoginID" type="text" class="form-control required" placeholder="" readonly>
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="formtitle required">人员姓名</div>
                    <div class="formcontent">
                        <input name="DisplayName" type="text" class="form-control required">
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-6">
                    <div class="formtitle">性别</div>
                    <div class="formcontent">
                        <div class="formcontent">
                            <label class="radio-inline">
                                <input type="radio" name="Sex" checked value="100">男
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="Sex" value="200">女
                            </label>
                        </div>
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="formtitle">手机号码</div>
                    <div class="formcontent">
                        <input name="Mobile" type="text" class="form-control">
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-6">
                    <div class="formtitle">邮箱</div>
                    <div class="formcontent">
                        <input name="Email" type="text" class="form-control" placeholder="">
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="formtitle">办公电话</div>
                    <div class="formcontent">
                        <input name="TelePhoneOffice" type="text" class="form-control">
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-6">
                    <div class="formtitle">家庭电话</div>
                    <div class="formcontent">
                        <input name="TelePhoneHome" type="text" class="form-control" placeholder="">
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="formtitle">状态</div>
                    <div class="formcontent">
                        <label class="radio-inline">
                            <input type="radio" name="Enable" checked value="100">启用
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Enable" value="200">禁用
                        </label>
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-6">
                    <div class="formtitle">身份证号码</div>
                    <div class="formcontent">
                        <input name="IdentityCardNum" type="text" class="form-control" placeholder="">
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="formtitle">车牌号</div>
                    <div class="formcontent">
                        <input name="CarNum" type="text" class="form-control">
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-6">
                    <div class="formtitle">生日</div>
                    <div class="formcontent">
                        <input name="Birthday" type="text" class="form-control form-date" placeholder="">
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="formtitle">QQ</div>
                    <div class="formcontent">
                        <input name="QQNumber" type="text" class="form-control">
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-6">
                    <div class="formtitle">邮政地址</div>
                    <div class="formcontent">
                        <input name="PostalAddress" type="text" class="form-control" placeholder="">
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="formtitle">邮政号码</div>
                    <div class="formcontent">
                        <input name="PostalCode" type="text" class="form-control">
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-6">
                    <div class="formtitle">排序</div>
                    <div class="formcontent">
                        <input name="SortNum" type="text" class="form-control" placeholder="" value="0">
                    </div>
                </div>
            </div>
            <div style="display:none">
                <input name="UserGuid" type="text" class="form-control" placeholder="">
            </div>
            <div class="row formbtnop">
                <button class="btn btn-primary cloudbtn" type="button" onclick="Save()">保 存</button>
                <button class="btn cloudbtn" type="button" onclick="Close()">关 闭</button>
            </div>
        </form>
    </div>
    <script>
        var formvalidator = $("#form").validate();
        $(function () {
            LoadDetail();
        })
        function LoadDetail() {
            var param = { "UserGuid": GetUrlParam("userguid") }
            CloudPost(param, "opdetail", function (res) {
                if (res.code == 0) {
                    $("#form").SetForm(res.data);
                    $("#OUGuid").attr("selectvalue", res.data.OUGuid);
                    RenderTree();
                }
            })
        }

        function Save() {
            if (formvalidator.form()) {
                var param = $("#form").GetForm();
                param.OUGuid = GetTreeSelectValue("OUGuid");
                CloudPost(param, "opupdate", function (res) {
                    if (res.code == 0) {
                        OpenSuccess("保存成功！", function () {
                            CloseDialog();
                        })
                    } else {
                        OpenFail(res.data)
                    }
                })
            }
        }
        function Close() {
            CloseDialog();
        }
    </script>
</body>
</html>
